<?php

/*
 * 函数库文件,存放所有的公共函数
 * 
 * Author:wyouyu by:2012-09-15
 */


//过滤用户输入的值并把提取的值自动赋值给表单元素的name
function Add_S($array)
{
    foreach($array as $key=>$value)
    {
        if(!is_array($value))
        {
             $value = str_replace('&#x','& # x',$value);
             $value = preg_replace('/eval/i','eva l',$value);
             if(!get_magic_quotes_gpc())
             {
                 $value = addslashes($value);
             }
             $array[$key] = $value;
             
        }
        else
        {
            $array[$key] = Add_S($value);
        }
    }
    return $array;
}
//获取所有的网站配置
function GetBaseConfig()
{
    global $db;
    $result = $db->query("select * from ".DBPREFIX."setting");
    $baseConfig = array();
    while($row = $db->fetch_array($result))
    {
        $baseConfig[] = $row;
    }
    return $baseConfig;
}

?>
